package com.rraj.controller;


import com.rraj.client.ConfigClient;
import org.omg.CORBA.Environment;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


/**
 * 这边的@RefreshScope注解不能少，否则即使调用/refresh，配置也不会刷新
 * @author eacdy
 */
@RestController
@RefreshScope
public class ConfigClientController {


    @Value("${profile}")
    private String profile;

    @RequestMapping("config")
    public String getConfig(){
        return profile;
    }


}
